<?php
/**
 * Created by PhpStorm.
 * User: cong.ding
 * Date: 2017/10/10
 * Time: 16:46
 */

include_once("DBUtil.php");
include_once("common_util.php");

$db =new DBUtil();

$result=["result"=>"","message"=>""];

//array_push($data,$data);
$data =array(
  "type"=>_post('type'),
  "name"=>_post('name'),
  "qr_code"=>_post('qr_code'),
  "arrived_time"=>check_date_default(_post('arrived_time')),
  "purchase_time"=>check_date_default(_post('purchase_time')),
  "produce_time"=>check_date(_post('produce_time')),
  "expire_time"=>check_date(_post('expire_time')),
  "count"=>_post('count'),
  "comment"=>_post('comment')
);
$result_id =$db->update("goods_info",$data,"uuid="._post('uuid'));
//if (!isset($result_id)||empty($result_id)) {
//  $result["result"]=false;
//  $result["message"]= mysqli_error($db);
//} else {
//  $result["result"]=true;
//}
$result["result"]=true;

$output =json_encode(["data"=>$result]);
echo  $output;